﻿<Window x:Class="Pomo.PomoWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Pomo" mc:Ignorable="d" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:myapp="clr-namespace:Pomo"
        Background="Transparent" AllowsTransparency="True"  ResizeMode="NoResize" 
        ShowInTaskbar="False" Topmost="True" WindowStyle="None" 
        SizeToContent="WidthAndHeight"
        >
    <Window.Resources>
        <myapp:Pomodoro x:Key="pomo1"/>
        <myapp:PomoStatusToColorConverter x:Key="pomoStatusToColorConverter"/>
        <myapp:PomoStatusToDarkColorConverter x:Key="pomoStatusToDarkColorConverter"/>
    </Window.Resources>
    <StackPanel x:Name="stackPanel1" DataContext="{StaticResource pomo1}" Height="20" ToolTip="{Binding Path=Task}" HorizontalAlignment="Center" Width="Auto" Orientation="Horizontal" >
        <Border x:Name="controlRectangle" BorderBrush="Black" BorderThickness="2" Width="20" CornerRadius="6">
            <Border.Background>
                <LinearGradientBrush StartPoint="1,.5" >
                    <GradientStop Color="{Binding Path=Status, Converter={StaticResource pomoStatusToColorConverter}, FallbackValue=Red, Mode=OneWay}" Offset="0" />
                    <GradientStop Color="{Binding Path=Status, Converter={StaticResource pomoStatusToDarkColorConverter}, FallbackValue=Red, Mode=OneWay}" Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
        </Border>
        <Border CornerRadius="6" BorderThickness="0" BorderBrush="Black" Height="20" Background="Black"  >
            <TextBlock x:Name="timeTextBox" Width="40" TextAlignment="Center" VerticalAlignment="Center" Foreground="White" Text="{Binding Path=RemainingMMSS, Mode=OneWay}" FontSize="14"/>
        </Border>
        <Border x:Name="xBorder" CornerRadius="6" Width="20" Height="20" BorderBrush="Black" Background="Black">
            <Path Stretch="Uniform" Margin="3">
                <Path.Fill>
                    <LinearGradientBrush StartPoint="1,.5" >
                        <GradientStop Color="{Binding Path=Status, Converter={StaticResource pomoStatusToColorConverter}, FallbackValue=Red, Mode=OneWay}" Offset="0" />
                        <GradientStop Color="{Binding Path=Status, Converter={StaticResource pomoStatusToDarkColorConverter}, FallbackValue=Red, Mode=OneWay}" Offset="1" />
                    </LinearGradientBrush>
                </Path.Fill>
                <Path.Data>
                    <PathGeometry Figures="M23.334134,13.383936L18.171824,18.543956 30.560914,30.933036 18.171824,43.322116 23.334134,48.482146 35.723214,36.095346 48.110014,48.482146 53.272324,43.322116 40.883244,30.933036 53.272324,18.543956 48.110014,13.383936 35.723214,25.770736 23.334134,13.383936z" />
                </Path.Data>
            </Path>
        </Border>
    </StackPanel>
</Window>
